﻿@{
    ViewData["Title"] = "定时任务";
    Layout = "~/Views/Shared/Vue.cshtml";
}
<link rel="stylesheet" href="~/lib/corn/font/font-awesome.min.css">
    <link href="~/lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />

        <link href="/lib/corn/cronGen.css" rel="stylesheet" />

        <script src="~/lib/jquery/dist/jquery.min.js?v=2"></script>
    <script src="~/lib/corn/cronGen.min.js?v=2.0"></script>
           <script src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script>


<div id="task-container" v-cloak>
    <Modal v-model="log.model" draggable
           v-bind:title="log.title"
           width="460"
           v-bind:mask-closable="log.closable"
           v-bind:footer-hide="log.footerHide"
           class-name="vertical-center-modal log-header">
        <div class="log-model-content">
            <el-scrollbar style="height:100%;">
                <div style="padding-bottom: 20px;"> <i-button type="dashed" @@click="first">首页</i-button> <i-button type="dashed" @@click="next">下一页</i-button></div>
                <div class="log-spin" v-show="log.spin">
                    <Spin></Spin>
                </div>
                <Timeline>
                    <Timeline-Item v-for="(item,index) in log.data" v-bind:key="index" color="green">
                        <p class="time"><span>{{log.index+index}}、</span>{{item.beginDate}} -- {{item.endDate}}</p>
                        <p class="content">{{item.msg}}</p>
                    </Timeline-Item>
                </Timeline>
            </el-scrollbar>
        </div>
    </Modal>

    <Drawer v-model="model"
            v-bind:title="modelMessage"
            width="660"
            v-bind:mask-closable="closable"
            v-bind:footer-hide="footerHide">
        <div class="model-content">
            <i-form ref="formValidate" :label-width="120" v-bind:model="taskValidate" v-bind:rules="ruleValidate">
                <Row>
                    <i-Col span="12">
                        <form-item v-bind:label="taskForm[0].text+'：'" v-bind:prop="taskForm[0].name">
                            <i-input v-model="taskValidate[taskForm[0].name]" v-bind:id="taskForm[0].name" v-bind:class="{'read-only':taskForm[0].readOnly}" v-bind:placeholder="taskForm[0].placeholder"></i-input>
                        </form-item>
                    </i-Col>
                    <i-Col span="12">
                        <form-item v-bind:label="taskForm[1].text+'：'" v-bind:prop="taskForm[1].name">
                            <i-input v-model="taskValidate[taskForm[1].name]" v-bind:id="taskForm[1].name" v-bind:class="{'read-only':taskForm[1].readOnly}" v-bind:placeholder="taskForm[1].placeholder"></i-input>
                        </form-item>
                    </i-Col>
                </Row>
                <Row>
                    <i-Col span="12">
                        <form-item v-bind:label="taskForm[2].text+'：'" v-bind:prop="taskForm[2].name">
                            <i-input v-model="taskValidate[taskForm[2].name]" v-bind:id="taskForm[2].name" v-bind:class="{'read-only':taskForm[2].readOnly}" v-bind:placeholder="taskForm[2].placeholder"></i-input>
                        </form-item>
                    </i-Col>
                    <i-Col span="12">
                        <form-item v-bind:label="taskForm[3].text+'：'" v-bind:prop="taskForm[3].name">
                            <i-select v-model="taskValidate[taskForm[3].name]" v-bind:id="taskForm[3].name" v-bind:class="{'read-only':taskForm[3].readOnly}" v-bind:placeholder="taskForm[3].placeholder">
                                <i-option v-for="item in selectCom.data" :value="item.value" :key="item.value">{{ item.label }}</i-option>
                            </i-select>
                        </form-item>
                    </i-Col>
                </Row>

                <Row>
                    <form-item v-bind:label="taskForm[4].text+'：'" v-bind:prop="taskForm[4].name">
                        <i-input v-model="taskValidate[taskForm[4].name]" type="text" v-bind:id="taskForm[4].name" v-bind:class="{'read-only':taskForm[4].readOnly}" v-bind:placeholder="taskForm[4].placeholder"></i-input>
                    </form-item>
                </Row>
                <form-item v-bind:label="taskForm[5].text+'：'" v-bind:prop="taskForm[5].name">
                    <i-input v-model="taskValidate[taskForm[5].name]" v-bind:id="taskForm[5].name" v-bind:class="{'read-only':taskForm[5].readOnly}" v-bind:placeholder="taskForm[5].placeholder"></i-input>
                </form-item>
                <form-item v-bind:label="taskForm[6].text+'：'" v-bind:prop="taskForm[6].name">
                    <i-input v-model="taskValidate[taskForm[6].name]" v-bind:id="taskForm[6].name" v-bind:class="{'read-only':taskForm[6].readOnly}" v-bind:placeholder="taskForm[6].placeholder">
                    </i-input>
                </form-item>
     
                <form-item v-bind:label="taskForm[7].text+'：'" v-bind:prop="taskForm[7].name">
                    <i-input v-model="taskValidate[taskForm[7].name]" v-bind:id="taskForm[7].name" v-bind:class="{'read-only':taskForm[7].readOnly}" v-bind:placeholder="taskForm[7].placeholder"></i-input>
                </form-item>
                <form-item v-bind:label="taskForm[8].text+'：'" v-bind:prop="taskForm[8].name">
                    <i-input v-model="taskValidate[taskForm[8].name]" type="textarea" v-bind:id="taskForm[8].name" v-bind:class="{'read-only':taskForm[8].readOnly}" v-bind:placeholder="taskForm[8].placeholder"></i-input>
                </form-item>
                 <form-item v-bind:label="taskForm[9].text+'：'" v-bind:prop="taskForm[9].name">
                    <i-input v-model="taskValidate[taskForm[9].name]" type="textarea" v-bind:id="taskForm[9].name" v-bind:class="{'read-only':taskForm[9].readOnly}" v-bind:placeholder="taskForm[9].placeholder"></i-input>
                </form-item>
                <div class="submit-btn">

                    <i-button type="primary" @@click="handleSubmit('formValidate')">保存</i-button>
                </div>
            </i-form>
        </div>
    </Drawer>
    <div class="task-content">
        <div class="task-btn">
            <div class="desc-text">
                <span class="ivu-icon ivu-icon-ios-cube"> </span>
                <span> 后台任务列表</span>
            </div>
            <i-button type="info" style="margin-left: 150px;" icon="md-add" @@click="add">新建任务</i-button>
            @* <i-button type="success" @@click="tiggerAction('pause')" icon="ios-power">暂停选中任务</i-button>
                <i-button type="warning" @@click="tiggerAction('start')" icon="md-arrow-dropright">开启选中任务</i-button>
                <i-button type="primary" @@click="tiggerAction('run')" icon="md-open">立即执行</i-button>*@
            <i-button type="info" icon="md-refresh" @@click="refresh(false)">刷新数据</i-button>
        </div>
        <i-table stripe ref="selection" @@on-select="selectRow" :columns="getColumns()" :data="rows">
        </i-table>
    </div>
</div>
<script src="~/js/task-index.js"></script>
<script>
    window.onload = function () {
      // $("#interval:last-child").cronGen({
            //direction : 'right'
            //});
 
        $headerVue.activedIndex = 0;
    }
</script>
